{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin django_bootstrap5 textfilters %}
{% block title %}Confirm new email address{% endblock %}
{% block content %}
    {% origin %}
    <h1>Confirm new email address</h1>
    {% if not can_confirm %}
        <p class="alert alert-danger my-3">
            An error has occurred when attempting to add the email address {{ email|linkify }} to your account {{ username }}.
        </p>
        {% bootstrap_form_errors form %}
        <a class="btn btn-primary my-3"
           href="{% url "ietf.ietfauth.views.profile" %}">Edit profile</a>
    {% elif new_email_obj %}
        {% if already_confirmed %} 
            <p class="alert alert-info my-3">
                Your account {{ username }} already includes the email address {{ email|linkify }}.
            </p>
        {% else %}
            <p class="alert alert-success my-3">
                Your account {{ username }} has been updated to include the email address {{ email|linkify }}.
            </p>
        {% endif %}
        <a class="btn btn-primary my-3"
           href="{% url "ietf.ietfauth.views.profile" %}">Edit profile</a>
    {% else %}
        <p class="alert alert-info my-3">
            Confirm that you want to add the email address {{ email|linkify }} to your account {{ username }}.
        </p>
        <form method="post" class="my-3">
            {% csrf_token %}
            <button type="submit" class="btn btn-warning" name="action" value="confirm">Confirm email address</button>
        </form>
    {% endif %}
{% endblock %}